package com.naiterui.ehp.bs.patient.service;

import com.naiterui.common.repository.page.PageParamVO;
import com.naiterui.common.repository.page.PageVO;
import com.naiterui.ehp.bp.bo.form.DesignFormBO;
import com.naiterui.ehp.bp.support.exception.BusinessException;
import com.naiterui.ehp.bs.doctor.vo.followup.AdCalendarPointVO;
import com.naiterui.ehp.bs.doctor.vo.followup.AdVisitVO;
import com.naiterui.ehp.bs.doctor.vo.followup.DrFollowUpCheckVO;
import com.naiterui.ehp.bs.doctor.vo.followup.DrFollowUpRecordFormVO;
import com.naiterui.ehp.bs.doctor.vo.followup.DrFollowUpRecordVO;
import com.naiterui.ehp.bs.doctor.vo.followup.DrFollowUpSubVisitVO;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * 随访计划
 *
 * @author yangfuya
 * @since 2022/1/5
 */
public interface IApFollowUpRecordService {

    /**
     * 分页获取随访集合列表
     *
     * @param patientId
     * @param status
     * @param pageParamVO
     * @return
     * @throws BusinessException
     */
    PageVO<DrFollowUpRecordVO> page(Long patientId, Integer status, PageParamVO pageParamVO) throws BusinessException;

    /**
     * 随访列表
     *
     * @param patientId
     * @param status
     * @return
     * @throws BusinessException
     */
    List<DrFollowUpRecordVO> list(Long patientId, Integer status) throws BusinessException;

    /**
     * 获取随访计划详情
     *
     * @param id
     * @return
     * @throws BusinessException
     */
    DrFollowUpRecordVO getById(Long id) throws BusinessException;

    /**
     * 根据随访表单id切换表单
     *
     * @param followUpRecordFormId 随访任务表单id
     * @return
     * @throws BusinessException
     */
    DrFollowUpRecordFormVO switchForm(Long followUpRecordFormId) throws BusinessException;

    /**
     * 保存表单数据
     *
     * @param followUpRecordFormId
     * @param data
     * @return
     * @throws BusinessException
     */
    DesignFormBO saveData(Long followUpRecordFormId, Map<String, Object> data) throws BusinessException;

    /**
     * 保存草稿箱
     *
     * @param followUpRecordFormId
     * @param data
     * @return
     * @throws BusinessException
     */
    DesignFormBO cacheSave(Long followUpRecordFormId, Map<String, Object> data) throws BusinessException;

    /**
     * 获取草稿箱
     *
     * @param followUpRecordFormId
     * @return
     * @throws BusinessException
     */
    Map<String, Object> cacheGet(Long followUpRecordFormId) throws BusinessException;

    /**
     * 上传表单文件
     *
     * @param file
     * @return
     * @throws BusinessException
     */
    String upload(MultipartFile file) throws BusinessException;

    /**
     * 随访任务到制定日期开始
     *
     * @throws BusinessException
     */
    void followUpStarted() throws BusinessException;

    /**
     * 随访任务到制定日期过期
     *
     * @throws BusinessException
     */
    void followUpFinish() throws BusinessException;

    /**
     * 检查随访任务
     *
     * @param followUpId
     * @throws BusinessException
     */
    DrFollowUpCheckVO checkFollowUp(Long followUpId) throws BusinessException;

    PageVO<AdVisitVO> getVisitTodayPage(Long patientId, String date, PageParamVO pageParamVO) throws BusinessException;

    List<AdCalendarPointVO> getMonthVisit(Long patientId, String month) throws BusinessException;

    List<DrFollowUpSubVisitVO> getSubsequentVisitByFollowNo(String followNo) throws BusinessException;

}
